home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_06_vol_opening.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  173 lines

  1. # Jones 3D Cog Script
  2. #
  3. # VOL_Opening.cog
  4. #
  5. #    [cmg]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     user0
  15.     
  16.     # Actors
  17.     thing        player                    local
  18.     thing        indyActor                
  19.     thing        fadeplate                
  20.     
  21.  
  22.     # Actor look targets
  23.     thing    face
  24.     
  25.  
  26.     # Camera objects
  27.     thing    sightCam1
  28.     thing    restoreCam
  29.     
  30.     # Camera targets
  31.     thing    faceMoveTarg    
  32.     
  33.     
  34.     # sounds
  35.     sound       in_wonder=vl01j01.wav            local    #kinda warm in here...
  36.     sound       mus_intro=mus_vol_intro.wav        local    #opening theme
  37.     
  38.     # keyframes
  39.     keyframe    in_hat=0in_figithat_4_4.key        local
  40.     keyframe    in_brush=0in_stand1_bd_4.key    local
  41.     keyframe    in_stand4=0in_stand4.key        local
  42.     
  43.     int            rotref                            local
  44.     int         track                            local
  45.     int         snd                                local
  46.  
  47.     int            bSeen=0                            local
  48.     int            gotstuff=0                        local
  49.  
  50. end
  51.  
  52. # ========================================================================================
  53.  
  54. code
  55.  
  56. startup:
  57.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  58.  
  59.     Sleep(0.001); # Let engine get set up
  60.     
  61.     if (bSeen) return;
  62.  
  63.     # fadeplate is solid
  64.     SetThingAlpha(fadeplate, 1.0);
  65.  
  66.     # Start on black...
  67.     SetCameraLookInterp(2, 0);
  68.     SetCameraPosInterp(2, 0);
  69.     SetCameraFocus(2, sightCam1);
  70.     SetCameraSecondaryFocus(2, faceMoveTarg);
  71.     SetCurrentCamera(2);
  72.     SetCameraFOV(45, 0, 0);
  73.  
  74.     return;
  75.  
  76. # ..............................................................................
  77.  
  78. user0: # RT: Indicates that autosave/restore has completed...
  79.  
  80.     if (bSeen) return; # RT
  81.     bSeen = 1;
  82.  
  83.     player = GetLocalPlayerThing();
  84.  
  85.     SetCameraLookInterp(2, 0);
  86.     SetCameraPosInterp(2, 0);
  87.     # Get the camera out in the room targeting the face
  88.     SetCameraFocus(2, sightCam1);
  89.     SetCameraSecondaryFocus(2, faceMoveTarg);
  90.     SetCurrentCamera(2);
  91.     SetCameraFOV(45, 0, 0);
  92.  
  93.     SetActorFlags(player, 0x200000);
  94.     StartCutScene(1);
  95.  
  96.     # SET UP THE ACTOR WITH CORRECT WEAPONS
  97.     CopyPlayerHolsters(player, indyActor);
  98.     TeleportThing(indyActor, player);
  99.     AISetCutSceneMode(indyActor);
  100.     AISetLookThing(indyActor, face);
  101.     rotref=(GetThingMaxRotVel(indyActor));
  102.     SetThingMaxRotVel(indyActor, 150);
  103.     SetThingFlags(player, 0x80000);
  104.     ClearThingFlags(indyActor, 0x80000);
  105.  
  106.     # wait for camera to get set up
  107.     Sleep(0.01);
  108.     
  109.     # fade in and play theme
  110.     ThingFadeAnim(fadeplate, 1.0, 0.0, 1.0, 0);
  111.     PlaySoundLocal(mus_intro, 0.75, 0.0, 0x0, 0);
  112.     
  113.     # move camera back from face
  114.     MoveToFrame(sightCam1, 1, 1.0);
  115.     SetCameraFOV(90, 1, 4.0);
  116.     
  117.     # move camera focus object to indy's position
  118.     MoveToFrame(faceMoveTarg, 1, 2.9); # was 3.0
  119.     Sleep(1.0);
  120.     SetThingFlags(fadeplate, 0x80000);
  121. #    DestroyThing(fadeplate);   
  122.     WaitForStop(sightCam1);
  123.  
  124.     # play indy's anims and voice line
  125.     track = PlayKey(indyActor, in_Stand4, 2, 0x0, 0);
  126.     PlayKey(indyActor, in_brush, 4, 0x12, 1);
  127.     Sleep(0.25);
  128.     snd = PlayVoice(indyActor, in_wonder, 1.0, 0);
  129.     PlayKey(indyActor, in_hat, 4, 0x12, 0); 
  130.     WaitForSound(snd);
  131.     Sleep(0.5);
  132.  
  133.     # put the player at actors' position, clear actor, show player
  134.     TeleportThing(player, indyActor);
  135.     AIClearCutSceneMode(indyActor);
  136.     ClearThingFlags(player, 0x80000);
  137.     SetThingFlags(indyActor, 0x80000);
  138.     
  139.     # Restore the cam, end the scene
  140.     ResetCameraFOV(0, 0.0);
  141.     SetCameraPosition(1, GetThingPos(restoreCam));
  142.     SetCurrentCamera(1);
  143. #    SetCurrentCamera(1);
  144.     ResetCameraFOV(0, 0.0);
  145.     EndCutScene();
  146.     
  147.     if (gotstuff == 0)
  148.     {
  149.         SetInv(player, 4, 250); # Tokarev
  150.         SetInvAvailable(player, 4, 1);
  151.         SetInv(player, 7, 1); # machete
  152.         SetInvAvailable(player, 7, 1);
  153.         SetInv(player, 49, 3); # firstaid
  154.         SetInvAvailable(player, 49, 1);
  155.         SetInv(player, 39, 2); # herbs
  156.         SetInvAvailable(player, 39, 1);
  157.         SetInv(player, 46, 3); # poisonkit
  158.         SetInvAvailable(player, 46, 1);
  159.  
  160.         gotstuff = 1;
  161.     }
  162.  
  163.     ClearActorFlags(player, 0x200000);
  164.     Sleep(0.01);
  165. #    SetCurrentCamera(1);
  166. #    ResetCameraFOV(0, 0.0);
  167.     
  168. return;
  169.  
  170. # ========================================================================================
  171. end
  172.  
  173.